<template>
  <ServiceFormRecordDetail v-if="show" :data="data"></ServiceFormRecordDetail>
</template>

<script lang="ts" setup>
  /* appServiceFormRecordDetail 表单详情 */
  import { onLoad } from '@/router';
  import ServiceFormRecordDetail from '../components/ServiceFormRecordDetail/index.vue';
  import { ref } from 'vue';
  import { appServiceTicketFormSnapshootDetail } from '@/api/serviceForm';
  import type { ServiceTicketFormSnapshootDetailResult } from '@/api/serviceForm/types';
  const data = ref<ServiceTicketFormSnapshootDetailResult>();
  const show = ref(false);
  onLoad<'serviceFormRecordDetail'>((options) => {
    appServiceTicketFormSnapshootDetail(options.id)
      .then((r) => {
        data.value = r;
      })
      .finally(() => {
        show.value = true;
      });
  });
</script>

<style lang="scss" scoped></style>
